<script setup lang="ts">
//获取安全区域

import type { Notice } from "@/types/home";

const { safeAreaInsets } = uni.getSystemInfoSync();
defineProps<{
  list: Notice[]
}>();
</script>

<template>
  <view class="index-navbar" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
    <!-- logo文字 -->
    <view class="logo">
      <!--      <image class="logo-image" src="@/static/images/logo.png"></image>-->
      <text class="logo-text">天门山·智慧导览</text>
    </view>
    <!-- 通知公告 -->
    <view class="search">
      <swiper class="importmant" autoplay interval="3000" circular vertical :indicator-dots="false">
        <swiper-item v-for="item in list" :key="item.noticeId">
          <view class="notification-item">{{ item.noticeTitle }}</view>
        </swiper-item>
      </swiper>
    </view>
  </view>
</template>

<style lang="scss">
/* 自定义导航条 */
.index-navbar {
  background-image: url(@/static/images/backgroundColor.png);
  background-size: cover;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 20px;

  .logo {
    display: flex;
    align-items: center;
    height: 64rpx;
    padding-left: 30rpx;
    padding-top: 20rpx;

    .logo-image {
      width: 166rpx;
      height: 39rpx;
    }

    .logo-text {
      flex: 1;
      line-height: 28rpx;
      color: #fff;
      margin: 2rpx 0 0 20rpx;
      padding-left: 20rpx;
    }
  }

  .search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10rpx 0 26rpx;
    height: 64rpx;
    margin: 16rpx 20rpx;
    color: #fff;
    font-size: 28rpx;
    border-radius: 32rpx;
    background-color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
  }

  .importmant {
    display: flex;
    align-items: center;
    height: 64rpx;
    line-height: 64rpx;
    color: #fff;
    font-size: 28rpx;
  }

  .notification-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64rpx;
  }
}
</style>
